package com.ddllh.irontomato;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ProgressBar;
import android.widget.ToggleButton;

public class TimerActivity extends Activity {
	//private int i=0;
	private ProgressBar progress;
	private Button button1;
	private Button button2;
	private ToggleButton toggleButton3;
	private ToggleButton toggleButton4;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.timer);
		
		button1=(Button)findViewById(R.id.toggle1);
		button2=(Button)findViewById(R.id.toggle2);
		toggleButton3=(ToggleButton)findViewById(R.id.toggle3);
		toggleButton4=(ToggleButton)findViewById(R.id.toggle4);
		progress=(ProgressBar)findViewById(R.id.progress_default);
		
		button1.setText(R.string.inInterupt);
		button2.setText(R.string.outInterupt);
		
		button1.setOnClickListener(new timeBtn1Listener());
		button2.setOnClickListener(new timeBtn2Listener());
		toggleButton3.setOnClickListener(new timeBtn3Listener());
		toggleButton4.setOnClickListener(new timeBtn4Listener());
	}
	
	class timeBtn1Listener implements OnClickListener{

		@Override
		public void onClick(View v) {
			// TODO Auto-generated method stub
			
		}
	}
	class timeBtn2Listener implements OnClickListener{

		@Override
		public void onClick(View v) {
			// TODO Auto-generated method stub
			
		}
		
	}
	class timeBtn3Listener implements OnClickListener{

		@Override
		public void onClick(View v) {
			// TODO Auto-generated method stub
			
		}
		
	}
	class timeBtn4Listener implements OnClickListener{

		@Override
		public void onClick(View v) {
			// TODO Auto-generated method stub
			
		}
		
	}
	
	public void MarkInternalInterruption(Task task) {
		task.mColumeValue[DbHelper.KEY_TASK_Internal_Interrupt_Times] = 
			Integer.toString(Integer.parseInt(task.mColumeValue[DbHelper.KEY_TASK_Internal_Interrupt_Times].trim()) + 1);
		DbHelper.getInstance().UpdateItem(DbHelper.TABLE_TASK, task);
	}
	
	public void MarkExternalInterruption(Task task) {
		task.mColumeValue[DbHelper.KEY_TASK_External_Interrupt_Times] = 
			Integer.toString(Integer.parseInt(task.mColumeValue[DbHelper.KEY_TASK_External_Interrupt_Times].trim()) + 1);
		DbHelper.getInstance().UpdateItem(DbHelper.TABLE_TASK, task);
	}

	public void ActivityBegin() {
	}
	
	public void ActivityFinish(Task task) {
		task.mColumeValue[DbHelper.KEY_TASK_Is_Finished] = "1";
		DbHelper.getInstance().UpdateItem(DbHelper.TABLE_TASK, task);
	}
	
	public void PomodoroBegin() {	
	}
	
	public void PpmodoroFinish() {
	}
}
